
import request from "../../request/server.ts";



export  interface  Result<T>{
    code:string,
    data:T,
    msg:string
}


export  interface UserInfoType{
    userCount?:string,
    userEmail?:string,
    userPassword:string,
    userPhone?:string,
    userSex?:number,
    userId?:string
}

/*export  interface UserRegisterInfoType{
    userName?: string,
    userPhone?: string,
    userEmail?: string,
    password1?:string,
    password2?:string
}*/

//登录
export function loginApi(data:UserInfoType):Promise<Result<any>>{
    return  request({
        method:"post",
        url:"/user/login",
        data
    })
}

//注册
export function registerApi(data:UserInfoType):Promise<Result<any>>{
    return  request({
        method:"post",
        url:"/user/register",
        data
    })
}